package com.study.controller;

import com.study.entity.Person;
import com.study.service.Neo4jService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/neo4j")
public class Neo4jController {

    @Autowired
    private Neo4jService neo4jService;


    @GetMapping("/findChildList")
    public List<Person> findChildList(String id) {
        System.out.println("id : " + id);
        return neo4jService.findChildList(id);
    }

    @GetMapping("/createPerson")
    public String createPerson() {
        neo4jService.createPerson();
        return "ok";
    }

}
